var express = require('express');
var router = express.Router();
var Mock = require('mockjs');



/* GET home page. */
router.get('/', function(req, res,next) {

    let userData=Mock.mock({
        "data1|3":[{
            "number|150-250":1,
        }],
        "data2|3":[{
            "number|300-370":1,
        }],
        "data3|3":[{
            "number|100-160":1,
        }],
        "data4|6":[{
            "number|100000-160000":1,
        }],
        "pre1|80-90":1,
        "pre2|70-80":1,
    })
    let data={};
    let data1=[];
    let data2=[];
    let data3=[];
    let data4=[];
    for (let i=0;i<3;i++){
        data1[i]=-userData.data1[i].number;
        data2[i]=-userData.data2[i].number;
        data3[i]=userData.data3[i].number;
    }
    for (let i=0;i<6;i++){
        data4[i]=userData.data4[i].number;
    }
    data["data1"]=data1;
    data["data2"]=data2;
    data["data3"]=data3;
    data["data4"]=data4;
    data["pre1"]=userData.pre1;
    data["pre2"]=userData.pre2;
    res.json(data);

});

module.exports = router;
